import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../view/Login'
import Register from '../view/Register'
import Home from '../view/Home'
// 安装路由
Vue.use(VueRouter);

// 配置导出路由
export default new VueRouter({
  routes: [{
    path: "/",
    redirect: "/login"
  },
  {
    name: "Login",
    path: '/login',
    component: Login
  },
  {
    name: "Register",
    path: '/register',
    component: Register
  },
  {
    name: "Home",
    path: '/im',
    component: () => import('@/views/im/home/index.vue'),
    children: [
      {
        name: "Chat",
        path: "/im/imchat",
        component: () => import('@/views/im/chat/index.vue'),
      },
      {
        name: "Friend",
        path: "/im/imfriend",
        component: () => import('@/views/im/friend/index.vue'),
      },
      {
        name: "GROUP",
        path: "/im/imgroup",
        component: () => import('@/views/im/group/index.vue'),
      }
    ]
  }
  ]

});
